package com.lee.springCloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author Lee
 * @createDate 2021/12/22 17:04
 */
@Configuration
public class ApplicationContextConfig {
    @Bean
    /**使用@LoadBalanced注解赋予RlstTemplate负载均衡的能力**/
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
